From 1009fed86a06f3ede9ccca66599758311308fe18 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 28 Nov 2024 16:55:12 +0800 Subject: [PATCH] Replace all uses of qAsConst with std::as_const Fixes deprecation warnings on Qt 6.8.0 Signed-off-by: Claudio Cambra --- .../kmessagewidget/kmessagewidget.cpp | 2 +- src/cmd/simplesslerrorhandler.cpp | 4 ++-- src/gui/accountmanager.cpp | 2 +- src/gui/application.cpp | 2 +- src/gui/editlocallyjob.cpp | 2 +- src/gui/filedetails/sharemodel.cpp | 4 ++-- src/gui/folder.cpp | 2 +- src/gui/folderman.cpp | 24 +++++++++---------- src/gui/folderstatusmodel.cpp | 4 ++-- src/gui/navigationpanehelper.cpp | 6 ++--- src/gui/owncloudgui.cpp | 2 +- src/gui/socketapi/socketapi.cpp | 6 ++--- src/gui/syncconflictsmodel.cpp | 4 ++-- .../tray/unifiedsearchresultslistmodel.cpp | 4 ++-- src/gui/tray/usermodel.cpp | 6 ++--- src/libsync/discovery.cpp | 2 +- src/libsync/owncloudpropagator.cpp | 2 +- src/libsync/propagateuploadng.cpp | 2 +- src/libsync/syncengine.cpp | 14 +++++------ src/libsync/syncfilestatustracker.cpp | 2 +- 20 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/3rdparty/kmessagewidget/kmessagewidget.cpp b/src/3rdparty/kmessagewidget/kmessagewidget.cpp index 70d594139..bbc8cf41f 100644 --- a/src/3rdparty/kmessagewidget/kmessagewidget.cpp +++ b/src/3rdparty/kmessagewidget/kmessagewidget.cpp @@ -154,7 +154,7 @@ void KMessageWidgetPrivate::createLayout() layout->addWidget(iconLabel); layout->addWidget(textLabel); - for (QToolButton *button : qAsConst(buttons)) { + for (QToolButton *button : std::as_const(buttons)) { layout->addWidget(button); } diff --git a/src/cmd/simplesslerrorhandler.cpp b/src/cmd/simplesslerrorhandler.cpp index f471403aa..50d55978e 100644 --- a/src/cmd/simplesslerrorhandler.cpp +++ b/src/cmd/simplesslerrorhandler.cpp @@ -27,7 +27,7 @@ bool SimpleSslErrorHandler::handleErrors(QList errors, const QSslConf } if (account->trustCertificates()) { - for (const auto &error : qAsConst(errors)) { + for (const auto &error : std::as_const(errors)) { certs->append(error.certificate()); } return true; @@ -35,7 +35,7 @@ bool SimpleSslErrorHandler::handleErrors(QList errors, const QSslConf bool allTrusted = true; - for (const auto &error : qAsConst(errors)) { + for (const auto &error : std::as_const(errors)) { if (!account->approvedCerts().contains(error.certificate())) { allTrusted = false; } diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp index a661f3eb3..ccfcfec4c 100644 --- a/src/gui/accountmanager.cpp +++ b/src/gui/accountmanager.cpp @@ -306,7 +306,7 @@ void AccountManager::save(bool saveCredentials) { const auto settings = ConfigFile::settingsWithGroup(QLatin1String(accountsC)); settings->setValue(QLatin1String(versionC), maxAccountsVersion); - for (const auto &acc : qAsConst(_accounts)) { + for (const auto &acc : std::as_const(_accounts)) { settings->beginGroup(acc->account()->id()); saveAccountHelper(acc->account().data(), *settings, saveCredentials); settings->endGroup(); diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 1bf8cffea..dcac6ad32 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -199,7 +199,7 @@ bool Application::configVersionMigration() settings->endGroup(); // Wipe confusing keys from the future, ignore the others - for (const auto &badKey : qAsConst(deleteKeys)) { + for (const auto &badKey : std::as_const(deleteKeys)) { settings->remove(badKey); } } diff --git a/src/gui/editlocallyjob.cpp b/src/gui/editlocallyjob.cpp index 07a1d8f2a..cac6de6d1 100644 --- a/src/gui/editlocallyjob.cpp +++ b/src/gui/editlocallyjob.cpp @@ -514,7 +514,7 @@ void EditLocallyJob::lockFile(const QString &etag) void EditLocallyJob::disconnectFolderSignals() { - for (const auto &connection : qAsConst(_folderConnections)) { + for (const auto &connection : std::as_const(_folderConnections)) { disconnect(connection); } } diff --git a/src/gui/filedetails/sharemodel.cpp b/src/gui/filedetails/sharemodel.cpp index a19923199..73441a062 100644 --- a/src/gui/filedetails/sharemodel.cpp +++ b/src/gui/filedetails/sharemodel.cpp @@ -385,7 +385,7 @@ void ShareModel::handlePlaceholderLinkShare() auto linkSharePresent = false; auto placeholderLinkSharePresent = false; - for (const auto &share : qAsConst(_shares)) { + for (const auto &share : std::as_const(_shares)) { const auto shareType = share->getShareType(); if (!linkSharePresent && shareType == Share::TypeLink) { @@ -415,7 +415,7 @@ void ShareModel::handleSecureFileDropLinkShare() auto linkSharePresent = false; auto secureFileDropLinkSharePresent = false; - for (const auto &share : qAsConst(_shares)) { + for (const auto &share : std::as_const(_shares)) { const auto shareType = share->getShareType(); if (!linkSharePresent && shareType == Share::TypeLink) { diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 6b7f2ad45..fffbb11e5 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -1760,7 +1760,7 @@ void Folder::removeLocalE2eFiles() const auto existingBlacklistSet = QSet{existingBlacklist.begin(), existingBlacklist.end()}; auto expandedBlacklistSet = QSet{existingBlacklist.begin(), existingBlacklist.end()}; - for (const auto &path : qAsConst(e2eFoldersToBlacklist)) { + for (const auto &path : std::as_const(e2eFoldersToBlacklist)) { expandedBlacklistSet.insert(path); } diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index d3f6cd363..bf7e606de 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -226,7 +226,7 @@ int FolderMan::setupFolders() emit folderListChanged(_folderMap); - for (const auto folder : qAsConst(_folderMap)) { + for (const auto folder : std::as_const(_folderMap)) { folder->processSwitchedToVirtualFiles(); } @@ -768,7 +768,7 @@ void FolderMan::slotRunOneEtagJob() { if (_currentEtagJob.isNull()) { Folder *folder = nullptr; - for (Folder *f : qAsConst(_folderMap)) { + for (Folder *f : std::as_const(_folderMap)) { if (f->etagJob()) { // Caveat: always grabs the first folder with a job, but we think this is Ok for now and avoids us having a separate queue. _currentEtagJob = f->etagJob(); @@ -898,7 +898,7 @@ void FolderMan::startScheduledSyncSoon() void FolderMan::slotStartScheduledFolderSync() { if (isAnySyncRunning()) { - for (auto f : qAsConst(_folderMap)) { + for (auto f : std::as_const(_folderMap)) { if (f->isSyncRunning()) qCInfo(lcFolderMan) << "Currently folder " << f->remoteUrl().toString() << " is running, wait for finish!"; } @@ -1028,12 +1028,12 @@ void FolderMan::runEtagJobIfPossible(Folder *folder) void FolderMan::slotAccountRemoved(AccountState *accountState) { QVector foldersToRemove; - for (const auto &folder : qAsConst(_folderMap)) { + for (const auto &folder : std::as_const(_folderMap)) { if (folder->accountState() == accountState) { foldersToRemove.push_back(folder); } } - for (const auto &folder : qAsConst(foldersToRemove)) { + for (const auto &folder : std::as_const(foldersToRemove)) { removeFolder(folder); } } @@ -1050,7 +1050,7 @@ void FolderMan::slotRemoveFoldersForAccount(AccountState *accountState) } } - for (const auto &f : qAsConst(foldersToRemove)) { + for (const auto &f : std::as_const(foldersToRemove)) { removeFolder(f); } emit folderListChanged(_folderMap); @@ -1070,7 +1070,7 @@ void FolderMan::slotServerVersionChanged(Account *account) qCWarning(lcFolderMan) << "The server version is unsupported:" << account->serverVersion() << "pausing all folders on the account"; - for (auto &f : qAsConst(_folderMap)) { + for (auto &f : std::as_const(_folderMap)) { if (f->accountState()->account().data() == account) { f->setSyncPaused(true); } @@ -1088,7 +1088,7 @@ void FolderMan::slotWatchedFileUnlocked(const QString &path) void FolderMan::slotScheduleFolderByTime() { - for (const auto &f : qAsConst(_folderMap)) { + for (const auto &f : std::as_const(_folderMap)) { // Never schedule if syncing is disabled or when we're currently // querying the server for etags if (!f->canSync() || f->etagJob()) { @@ -1462,7 +1462,7 @@ void FolderMan::slotWipeFolderForAccount(AccountState *accountState) } bool success = false; - for (const auto &f : qAsConst(foldersToRemove)) { + for (const auto &f : std::as_const(foldersToRemove)) { if (!f) { qCCritical(lcFolderMan) << "Can not remove null folder"; return; @@ -1665,7 +1665,7 @@ void FolderMan::trayOverallStatus(const QList &folders, auto runSeen = false; auto various = false; - for (const Folder *folder : qAsConst(folders)) { + for (const Folder *folder : std::as_const(folders)) { // We've already seen an error, worst case met. // No need to check the remaining folders. if (errorsSeen) { @@ -1967,7 +1967,7 @@ void FolderMan::setIgnoreHiddenFiles(bool ignore) { // Note that the setting will revert to 'true' if all folders // are deleted... - for (Folder *folder : qAsConst(_folderMap)) { + for (Folder *folder : std::as_const(_folderMap)) { folder->setIgnoreHiddenFiles(ignore); folder->saveToSettings(); } @@ -2015,7 +2015,7 @@ void FolderMan::slotProcessFilesPushNotification(Account *account) { qCInfo(lcFolderMan) << "Got files push notification for account" << account; - for (auto folder : qAsConst(_folderMap)) { + for (auto folder : std::as_const(_folderMap)) { // Just run on the folders that belong to this account if (folder->accountState()->account() != account) { continue; diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 44b2402c4..91808fc48 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -833,7 +833,7 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list) endInsertRows(); } - for (const auto undecidedIndex : qAsConst(undecidedIndexes)) { + for (const auto undecidedIndex : std::as_const(undecidedIndexes)) { emit suggestExpand(index(undecidedIndex, 0, parentIdx)); } /* Try to remove from the undecided lists the items that are not on the server. */ @@ -916,7 +916,7 @@ void FolderStatusModel::slotUpdateFolderState(Folder *folder) void FolderStatusModel::slotApplySelectiveSync() { - for (const auto &folderInfo : qAsConst(_folders)) { + for (const auto &folderInfo : std::as_const(_folders)) { if (!folderInfo._fetched) { folderInfo._folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, QStringList()); continue; diff --git a/src/gui/navigationpanehelper.cpp b/src/gui/navigationpanehelper.cpp index cf792084a..027d0ddea 100644 --- a/src/gui/navigationpanehelper.cpp +++ b/src/gui/navigationpanehelper.cpp @@ -48,7 +48,7 @@ void NavigationPaneHelper::setShowInExplorerNavigationPane(bool show) _showInExplorerNavigationPane = show; // Re-generate a new CLSID when enabling, possibly throwing away the old one. // updateCloudStorageRegistry will take care of removing any unknown CLSID our application owns from the registry. - for (const auto &folder : qAsConst(_folderMan->map())) { + for (const auto &folder : std::as_const(_folderMan->map())) { folder->setNavigationPaneClsid(show ? QUuid::createUuid() : QUuid()); } @@ -89,7 +89,7 @@ void NavigationPaneHelper::updateCloudStorageRegistry() // Then re-save every folder that has a valid navigationPaneClsid to the registry. // We currently don't distinguish between new and existing CLSIDs, if it's there we just // save over it. We at least need to update the tile in case we are suddently using multiple accounts. - for (const auto &folder : qAsConst(_folderMan->map())) { + for (const auto &folder : std::as_const(_folderMan->map())) { if (!folder->navigationPaneClsid().isNull()) { // If it already exists, unmark it for removal, this is a valid sync root. entriesToRemove.removeOne(folder->navigationPaneClsid()); @@ -161,7 +161,7 @@ void NavigationPaneHelper::updateCloudStorageRegistry() } // Then remove anything that isn't in our folder list anymore. - for (const auto &clsid : qAsConst(entriesToRemove)) { + for (const auto &clsid : std::as_const(entriesToRemove)) { const auto clsidStr = clsid.toString(); const QString clsidPath = QString() % R"(Software\Classes\CLSID\)" % clsidStr; const QString clsidPathWow64 = QString() % R"(Software\Classes\Wow6432Node\CLSID\)" % clsidStr; diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index dccdcc3a8..7323a8d5b 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -361,7 +361,7 @@ void ownCloudGui::slotComputeOverallSyncStatus() #else QStringList messages; messages.append(tr("Disconnected from accounts:")); - for (const auto &accountState : qAsConst(problemAccounts)) { + for (const auto &accountState : std::as_const(problemAccounts)) { QString message = tr("Account %1: %2").arg(accountState->account()->displayName(), accountState->stateString(accountState->state())); if (!accountState->connectionErrors().empty()) { message += QLatin1String("\n"); diff --git a/src/gui/socketapi/socketapi.cpp b/src/gui/socketapi/socketapi.cpp index 071ae448b..cf47d3f5b 100644 --- a/src/gui/socketapi/socketapi.cpp +++ b/src/gui/socketapi/socketapi.cpp @@ -472,7 +472,7 @@ void SocketApi::slotRegisterPath(const QString &alias) Folder *f = FolderMan::instance()->folder(alias); if (f) { const QString message = buildRegisterPathMessage(removeTrailingSlash(f->path())); - for (const auto &listener : qAsConst(_listeners)) { + for (const auto &listener : std::as_const(_listeners)) { qCInfo(lcSocketApi) << "Trying to send SocketAPI Register Path Message -->" << message << "to" << listener->socket; listener->sendMessage(message); } @@ -519,7 +519,7 @@ void SocketApi::slotUpdateFolderView(Folder *f) void SocketApi::broadcastMessage(const QString &msg, bool doWait) { - for (const auto &listener : qAsConst(_listeners)) { + for (const auto &listener : std::as_const(_listeners)) { listener->sendMessage(msg, doWait); } } @@ -639,7 +639,7 @@ void SocketApi::broadcastStatusPushMessage(const QString &systemPath, SyncFileSt QString msg = buildMessage(QLatin1String("STATUS"), systemPath, fileStatus.toSocketAPIString()); Q_ASSERT(!systemPath.endsWith('/')); uint directoryHash = qHash(systemPath.left(systemPath.lastIndexOf('/'))); - for (const auto &listener : qAsConst(_listeners)) { + for (const auto &listener : std::as_const(_listeners)) { listener->sendMessageIfDirectoryMonitored(msg, directoryHash); } } diff --git a/src/gui/syncconflictsmodel.cpp b/src/gui/syncconflictsmodel.cpp index 2ddbf0225..d6a7e702b 100644 --- a/src/gui/syncconflictsmodel.cpp +++ b/src/gui/syncconflictsmodel.cpp @@ -224,7 +224,7 @@ void SyncConflictsModel::selectAllConflicting(bool selected) void SyncConflictsModel::applySolution() { - for(const auto &syncConflict : qAsConst(_conflictData)) { + for(const auto &syncConflict : std::as_const(_conflictData)) { if (syncConflict.isValid()) { qCInfo(lcSyncConflictsModel) << syncConflict.mExistingFilePath << syncConflict.mConflictingFilePath << syncConflict.solution(); ConflictSolver solver; @@ -240,7 +240,7 @@ void SyncConflictsModel::updateConflictsData() _conflictData.clear(); _conflictData.reserve(_data.size()); - for (const auto &oneConflict : qAsConst(_data)) { + for (const auto &oneConflict : std::as_const(_data)) { const auto folder = FolderMan::instance()->folder(oneConflict._folder); if (!folder) { qCWarning(lcSyncConflictsModel) << "no Folder instance for" << oneConflict._folder; diff --git a/src/gui/tray/unifiedsearchresultslistmodel.cpp b/src/gui/tray/unifiedsearchresultslistmodel.cpp index 6ec9a7a2a..2f461683c 100644 --- a/src/gui/tray/unifiedsearchresultslistmodel.cpp +++ b/src/gui/tray/unifiedsearchresultslistmodel.cpp @@ -503,7 +503,7 @@ void UnifiedSearchResultsListModel::startSearch() endResetModel(); } - for (const auto &provider : qAsConst(_providers)) { + for (const auto &provider : std::as_const(_providers)) { startSearchForProvider(provider._id); } } @@ -725,7 +725,7 @@ void UnifiedSearchResultsListModel::removeFetchMoreTrigger(const QString &provid void UnifiedSearchResultsListModel::disconnectAndClearSearchJobs() { - for (const auto &connection : qAsConst(_searchJobConnections)) { + for (const auto &connection : std::as_const(_searchJobConnections)) { if (connection) { QObject::disconnect(connection); } diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index 30b3d699f..abddeaa10 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -236,7 +236,7 @@ void User::slotBuildNotificationDisplay(const ActivityList &list) return; } - for (const auto &activity : qAsConst(toNotifyList)) { + for (const auto &activity : std::as_const(toNotifyList)) { if (activity._objectType == QStringLiteral("chat")) { showDesktopTalkNotification(activity); } else { @@ -1308,7 +1308,7 @@ QString UserModel::currentUserServer() void UserModel::addUser(AccountStatePtr &user, const bool &isCurrent) { bool containsUser = false; - for (const auto &u : qAsConst(_users)) { + for (const auto &u : std::as_const(_users)) { if (u->account() == user->account()) { containsUser = true; continue; @@ -1424,7 +1424,7 @@ void UserModel::setCurrentUserId(const int id) const auto isCurrentUserChanged = !_users[id]->isCurrentUser(); if (isCurrentUserChanged) { - for (const auto user : qAsConst(_users)) { + for (const auto user : std::as_const(_users)) { user->setCurrentUser(false); } _users[id]->setCurrentUser(true); diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index e842f8254..4d8f57dfb 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -1858,7 +1858,7 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item) bool ProcessDirectoryJob::isAnyParentBeingRestored(const QString &file) const { - for (const auto &directoryNameToRestore : qAsConst(_discoveryData->_directoryNamesToRestoreOnPropagation)) { + for (const auto &directoryNameToRestore : std::as_const(_discoveryData->_directoryNamesToRestoreOnPropagation)) { if (file.startsWith(QString(directoryNameToRestore + QLatin1Char('/')))) { qCWarning(lcDisco) << "File" << file << " is within the tree that's being restored" << directoryNameToRestore; return true; diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index fc166ecce..5e4c5fa25 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -1236,7 +1236,7 @@ bool PropagatorCompositeJob::scheduleSelfOrChild() } // Ask all the running composite jobs if they have something new to schedule. - for (auto runningJob : qAsConst(_runningJobs)) { + for (auto runningJob : std::as_const(_runningJobs)) { ASSERT(runningJob->_state == Running); if (possiblyRunNextJob(runningJob)) { diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index 32e1192f3..e193e9561 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -185,7 +185,7 @@ void PropagateUploadFileNG::slotPropfindFinished() // Make sure that if there is a "hole" and then a few more chunks, on the server // we should remove the later chunks. Otherwise when we do dynamic chunk sizing, we may end up // with corruptions if there are too many chunks, or if we abort and there are still stale chunks. - for (const auto &serverChunk : qAsConst(_serverChunks)) { + for (const auto &serverChunk : std::as_const(_serverChunks)) { auto job = new DeleteJob(propagator()->account(), Utility::concatUrlPath(chunkUploadFolderUrl(), serverChunk.originalName), this); QObject::connect(job, &DeleteJob::finishedSignal, this, &PropagateUploadFileNG::slotDeleteJobFinished); _jobs.append(job); diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index c64b9219c..8d4915b48 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -292,7 +292,7 @@ void SyncEngine::conflictRecordMaintenance() // // This happens when the conflicts table is new or when conflict files // are downloaded but the server doesn't send conflict headers. - for (const auto &path : qAsConst(_seenConflictFiles)) { + for (const auto &path : std::as_const(_seenConflictFiles)) { ASSERT(Utility::isConflictFile(path)); auto bapath = path.toUtf8(); @@ -964,7 +964,7 @@ void SyncEngine::restoreOldFiles(SyncFileItemVector &syncItems) upload the client file. But we still downloaded the old file in a conflict file just in case */ - for (const auto &syncItem : qAsConst(syncItems)) { + for (const auto &syncItem : std::as_const(syncItems)) { if (syncItem->_direction != SyncFileItem::Down || syncItem->_isSelectiveSync) { continue; } @@ -1023,7 +1023,7 @@ void SyncEngine::finishSync() } if (_discoveryPhase && _discoveryPhase->_hasDownloadRemovedItems && _discoveryPhase->_hasUploadErrorItems) { - for (const auto &item : qAsConst(_syncItems)) { + for (const auto &item : std::as_const(_syncItems)) { if (item->_instruction == CSYNC_INSTRUCTION_ERROR && item->_direction == SyncFileItem::Up) { // item->_instruction = CSYNC_INSTRUCTION_IGNORE; } @@ -1103,7 +1103,7 @@ bool SyncEngine::handleMassDeletion() const auto allFilesDeleted = !_hasNoneFiles && _hasRemoveFile; auto deletionCounter = 0; - for (const auto &oneItem : qAsConst(_syncItems)) { + for (const auto &oneItem : std::as_const(_syncItems)) { if (oneItem->_instruction == CSYNC_INSTRUCTION_REMOVE) { if (oneItem->isDirectory()) { const auto result = _journal->listFilesInPath(oneItem->_file.toUtf8(), [&deletionCounter] (const auto &oneRecord) { @@ -1124,7 +1124,7 @@ bool SyncEngine::handleMassDeletion() if ((allFilesDeleted || filesDeletedThresholdExceeded) && displayDialog) { qCWarning(lcEngine) << "Many files are going to be deleted, asking the user"; int side = 0; // > 0 means more deleted on the server. < 0 means more deleted on the client - for (const auto &it : qAsConst(_syncItems)) { + for (const auto &it : std::as_const(_syncItems)) { if (it->_instruction == CSYNC_INSTRUCTION_REMOVE) { side += it->_direction == SyncFileItem::Down ? 1 : -1; } @@ -1455,7 +1455,7 @@ void SyncEngine::slotScheduleFilesDelayedSync() newTimer->callOnTimeout(this, [this, newTimer] { qCInfo(lcEngine) << "Rescanning now that delayed sync run is scheduled for:" << newTimer->files; - for (const auto &file : qAsConst(newTimer->files)) { + for (const auto &file : std::as_const(newTimer->files)) { this->_filesScheduledForLaterSync.remove(file); } @@ -1586,7 +1586,7 @@ void SyncEngine::slotUnscheduleFilesDelayedSync() return; } - for (const auto &file : qAsConst(_discoveryPhase->_filesUnscheduleSync)) { + for (const auto &file : std::as_const(_discoveryPhase->_filesUnscheduleSync)) { const auto fileSyncRunTimer = _filesScheduledForLaterSync.value(file); if (fileSyncRunTimer) { diff --git a/src/libsync/syncfilestatustracker.cpp b/src/libsync/syncfilestatustracker.cpp index 2b934806f..6e4e80962 100644 --- a/src/libsync/syncfilestatustracker.cpp +++ b/src/libsync/syncfilestatustracker.cpp @@ -268,7 +268,7 @@ void SyncFileStatusTracker::slotAboutToPropagate(SyncFileItemVector &items) // Swap into a copy since fileStatus() reads _dirtyPaths to determine the status QSet oldDirtyPaths; std::swap(_dirtyPaths, oldDirtyPaths); - for (const auto &oldDirtyPath : qAsConst(oldDirtyPaths)) + for (const auto &oldDirtyPath : std::as_const(oldDirtyPaths)) emit fileStatusChanged(getSystemDestination(oldDirtyPath), fileStatus(oldDirtyPath)); // Make sure to push any status that might have been resolved indirectly since the last sync -- 2.30.2